/*
 * @Description: 月计划调整接口
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2023-06-13 19:51:09
 * @LastEditTime: 2023-06-17 14:56:34
 * @FilePath: \cscec-pms-admin\src\api\construction\monthPlanAdjust.js
 */
import request from '@/utils/request2'
import { producerApisUrl, projectApiUrl } from '@/api/config'
const api = {
  list: {
    getMonthPlanList: producerApisUrl + '/monthPlanAdjust/getMonthPlanList',
    getMonthPlanStatistics: producerApisUrl + '/monthPlanAdjust/getMonthPlanStatistics',
    deleteBasis: producerApisUrl + '/monthPlanAdjust/deleteBasis'
  },
  view: {
    basisDetail: producerApisUrl + '/monthPlanAdjust/basis-detail',
    planLabel: projectApiUrl + '/plan-label',
    createBasis: producerApisUrl + '/monthPlanAdjust/createBasis',
    editBasis: producerApisUrl + '/monthPlanAdjust/editBasis',
    planAdjustDetail: producerApisUrl + '/monthPlanAdjust/plan-adjust-detail',
    createSiblingWorkPack: producerApisUrl + '/monthPlanAdjust/createSiblingWorkPack',
    createChildWorkPack: producerApisUrl + '/monthPlanAdjust/createChildWorkPack',
    createSiblingWork: producerApisUrl + '/monthPlanAdjust/createSiblingWork',
    createChildWork: producerApisUrl + '/monthPlanAdjust/createChildWork',
    moveUp: producerApisUrl + '/monthPlanAdjust/moveUp',
    moveDown: producerApisUrl + '/monthPlanAdjust/moveDown',
    editWorkPack: producerApisUrl + '/monthPlanAdjust/editWorkPack',
    editWork: producerApisUrl + '/monthPlanAdjust/editWork',
    removeWorkPack: producerApisUrl + '/monthPlanAdjust/removeWorkPack',
    removeWork: producerApisUrl + '/monthPlanAdjust/removeWork',
    commitAudit: producerApisUrl + '/monthPlanAdjust/commit-audit',
    queryHistoryAdjustDetail: producerApisUrl + '/monthPlanAdjust/query-history-adjust-detail'
  }
}
// 列表接口
const list = {
  /**
   * @description: 获取月计划调整列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  getMonthPlanList: data => {
    return request({
      url: api.list.getMonthPlanList,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取月计划调整列表统计
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  getMonthPlanStatistics: data => {
    return request({
      url: api.list.getMonthPlanStatistics,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除基本信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  deleteBasis: data => {
    return request({
      url: api.list.deleteBasis,
      method: 'post',
      data
    })
  }
}
// 详情页接口
const view = {
  /**
   * @description: 获取基本信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  basisDetail: data => {
    return request({
      url: `${api.view.basisDetail}/${data}`,
      method: 'get'
    })
  },
  /**
   * @description: 获取调整原因列表
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  planLabel: data => {
    return request({
      url: api.view.planLabel,
      method: 'get',
      params: data
    })
  },
  /**
   * @description: 新增基础信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createBasis: data => {
    return request({
      url: api.view.createBasis,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑基础信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editBasis: data => {
    return request({
      url: api.view.editBasis,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取预调整列表数据
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  planAdjustDetail: data => {
    return request({
      url: api.view.planAdjustDetail,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createSiblingWorkPack: data => {
    return request({
      url: api.view.createSiblingWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWorkPack: data => {
    return request({
      url: api.view.createChildWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增同级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createSiblingWork: data => {
    return request({
      url: api.view.createSiblingWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 新增下级业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  createChildWork: data => {
    return request({
      url: api.view.createChildWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 上移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveUp: data => {
    return request({
      url: api.view.moveUp,
      method: 'post',
      data
    })
  },
  /**
   * @description: 下移
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  moveDown: data => {
    return request({
      url: api.view.moveDown,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWorkPack: data => {
    return request({
      url: api.view.editWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 编辑业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  editWork: data => {
    return request({
      url: api.view.editWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除阶段/类别
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWorkPack: data => {
    return request({
      url: api.view.removeWorkPack,
      method: 'post',
      data
    })
  },
  /**
   * @description: 删除业务事项
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  removeWork: data => {
    return request({
      url: api.view.removeWork,
      method: 'post',
      data
    })
  },
  /**
   * @description: 提交审核
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  commitAudit: data => {
    return request({
      url: api.view.commitAudit,
      method: 'post',
      data
    })
  },
  /**
   * @description: 获取历史调整信息
   * @param {Object} data 接口参数
   * @return {Promise} 接口Promise
   */
  queryHistoryAdjustDetail: data => {
    return request({
      url: `${api.view.queryHistoryAdjustDetail}/${data}`,
      method: 'get'
    })
  },
}
export {
  list,
  view
}